﻿using UnityEngine;

public static partial class Extensions
{
    /// <summary>
    /// 取绝对值
    /// </summary>
    public static int Abs(this int value)
    {
        return Mathf.Abs(value);
    }
    
    /// <summary>
    /// 取绝对值
    /// </summary>
    public static float Abs(this float value)
    {
        return Mathf.Abs(value);
    }

    /// <summary>
    /// 向上取整
    /// </summary>
    public static int CeilToInt(this float value)
    {
        return Mathf.CeilToInt(value);
    }

    /// <summary>
    /// 向上取整
    /// </summary>
    public static float Ceil(this float value)
    {
        return Mathf.Ceil(value);
    }

    /// <summary>
    /// 向下取整
    /// </summary>
    public static int FloorToInt(this float value)
    {
        return Mathf.FloorToInt(value);
    }

    /// <summary>
    /// 向下取整
    /// </summary>
    public static float Floor(this float value)
    {
        return Mathf.Floor(value);
    }

    /// <summary>
    /// 夹紧
    /// </summary>
    public static int Clamp(this int value, int min, int max)
    {
        return Mathf.Clamp(value, min, max);
    }

    /// <summary>
    /// 夹紧
    /// </summary>
    public static float Clamp(this float value, float min, float max)
    {
        return Mathf.Clamp(value, min, max);
    }

    /// <summary>
    /// 最大值
    /// </summary>
    public static int Max(int a, int b)
    {
        return Mathf.Max(a, b);
    }

    /// <summary>
    /// 最大值
    /// </summary>
    public static int Max(params int[] values)
    {
        return Mathf.Max(values);
    }

    /// <summary>
    /// 最大值
    /// </summary>
    public static float Max(float a, float b)
    {
        return Mathf.Max(a, b);
    }

    /// <summary>
    /// 最大值
    /// </summary>
    public static float Max(params float[] values)
    {
        return Mathf.Max(values);
    }

    /// <summary>
    /// 最小值
    /// </summary>
    public static int Min(int a, int b)
    {
        return Mathf.Min(a, b);
    }

    /// <summary>
    /// 最小值
    /// </summary>
    public static int Min(params int[] values)
    {
        return Mathf.Min(values);
    }

    /// <summary>
    /// 最小值
    /// </summary>
    public static float Min(float a, float b)
    {
        return Mathf.Min(a, b);
    }

    /// <summary>
    /// 最小值
    /// </summary>
    public static float Min(params float[] values)
    {
        return Mathf.Min(values);
    }
}